-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scheduler: Replace the input parameter of AddScheduler with types.CheckerSchedulerType. #8416
Conversation
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8416 +/- ##
==========================================
- Coverage 77.35% 77.32% -0.04%
==========================================
Files 472 472
Lines 61903 61807 -96
==========================================
- Hits 47885 47790 -95
- Misses 10428 10448 +20
+ Partials 3590 3569 -21
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -70,3 +70,46 @@ const ( | |||
// LabelScheduler is label scheduler name. | |||
LabelScheduler CheckerSchedulerType = "label-scheduler" | |||
) | |||
|
|||
// SchedulerTypeCompatibleMap temporarily exists for compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding more explanation about when we need to consider the compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a need to explain in the code now. Its current role is only to do a layer of conversion when the user adds a scheduler. If it is used in more places in the future, or permanently exists in the code, I will add a more accurate description to it. How about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @rleungx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just wondering when we need to consider the compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an intermediate pr, it may be deleted in the subsequent pr, if it stays, I will add more comments
@@ -186,7 +185,8 @@ func (h *Handler) GetAllRequestHistoryHotRegion(request *HistoryHotRegionsReques | |||
} | |||
|
|||
// AddScheduler adds a scheduler. | |||
func (h *Handler) AddScheduler(name string, args ...string) error { | |||
func (h *Handler) AddScheduler(tp types.CheckerSchedulerType, args ...string) error { | |||
name := types.SchedulerTypeCompatibleMap[tp] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line may be removed in the subsequent pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
Signed-off-by: okJiang <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HuSharp, rleungx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@okJiang: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: Ref #8379
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note